import request from '@/utils/request'

export function getList(data) {
  return request({
    url: '/union-auth/tenant/list2',
    method: 'post',
    data
  })
}

// 创建 or 修改
export function createOrUpdate(data) {
  return request({
    url: '/union-auth/tenant/createOrUpdate',
    method: 'post',
    data
  })
}

export function deleteTenant(id) {
  return request({
    url: '/union-auth/tenant/' + id,
    method: 'delete'
  })
}

//禁用or启用该tenant下所有app 用户的登录功能
export function forbidAllUserLogin(tenantId, flag) {
  return request({
    url: '/union-auth/tenant/forbidAllUserLogin',
    method: 'get',
    params: { tenantId, flag }
  })
}
